package com.steven.download.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Handler;
import android.util.Log;

import com.steven.download.MainActivity;


/**
 * @Des:
 * @Author: hwz
 * @Date:2021/11/15 0015
 * @Version: 1.0
 */
public class BootRestartReceiver extends BroadcastReceiver {
    String ACTION = "android.intent.action.BOOT_COMPLETED";

    @Override
    public void onReceive(Context context, Intent intent) {
        Log.e("ddd ", "kkkkkkkkkkkkkkkkkonReceivekk：");
        if (intent.getAction() == ACTION){
            new Handler().postDelayed(new Runnable() {
                @Override
                public void run() {
                    Intent intent1 = new Intent(context, MainActivity.class);
                    intent1.putExtra("RUN_BACKGROUD",true);
                    context.startActivity(intent1);
                }
            },3000);
        }
    }
}
